<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>奇妙园游戏结果</title>
    <link rel="stylesheet" href="css/currency.css">
    <style>
        .xingxing{
            position: relative;
            top: -1640px;
            left: 244px;
        }
        .pingjia{
            width:100%;
            height:98px;
            font-size:42px;
            font-family:PingFangSC-Semibold;
            font-weight:600;
            color:rgba(255,255,255,1);
            line-height:98px;
            letter-spacing:1px;
            position: relative;
            top: -1640px;
            margin: 0 auto;
            text-align: center;
         }
        .evaluate{
            width:838px;
            height:277px;
            position: relative;
            top: -1580px;
            left: 118px;
            box-sizing: border-box;
            padding: 20px 42px 36px 42px;
            font-size:30px;
            font-family:PingFangSC-Regular;
            font-weight:400;
            color:rgba(37,76,6,1);
            line-height:42px;
        }
       /* .evaluate h1{
            font-size:40px;
            font-family:PingFangSC-Semibold;
            font-weight:600;
            color:rgba(37,76,6,1);
            line-height:98px;
            letter-spacing:1px;
            margin: 0;
        }*/
        .phone{
            width: 725px;
            height: 112px;
            background: rgba(253,255,250,1);
            border-radius: 15px;
            border: 3px solid #6394EB;
            position: relative;
            top: -1295px;
            left: 170px;
        }
        .code{
            width: 725px;
            height: 112px;
            background: rgba(253,255,250,1);
            border-radius: 15px;
            border: 3px solid #6394EB;
            position: relative;
            top: -1261px;
            left: 170px;
        }
        .phone::after,.code::after{
            content: "|";
            position: absolute;
            top: 36px;
            padding-top: 9px;
            left: 98px;
            color: #A2A2A2;
            height: 36px;
            background-color: #A2A2A2;
        }
        .phone img,.code img{
            margin: 36px 29px 39px 29px;
        }
        .phone input,.code input{
            width: 444px;
            height: 42px;
            font-size: 30px;
            font-weight: 400;
            color: #272727;
            line-height: 42px;
            border: none;
            outline: none;
            letter-spacing: 1px;
            position: relative;
            top: -55px;
            left: 35px;
        }
        .phone input::-webkit-input-placeholder { /* WebKit browsers */
            color: #BDBDBD;
        }
        .code input::-webkit-input-placeholder { /* WebKit browsers */
            color: #BDBDBD;
        }
        #send{
            width:137px;
            height:72px;
            background: #CEDFF4;
            border-radius:8px;
            position: relative;
            top: -65px;
            left: 20px;
            font-size:20px;
            font-weight:600;
            color: #565656;
            line-height:28px;
            outline: none;
            border: none;
        }
        .sms{
            width:437px;
            height:42px;
            font-size:30px;
            font-family:PingFangSC-Medium;
            font-weight:500;
            color:rgba(16,54,122,1);
            line-height:42px;
            letter-spacing:1px;
            position: relative;
            top: -1224px;
            left: 326px;
        }
        .submit{
            width: 388px;
            height: 110px;
            background: url(img/submit.png) no-repeat;
            position: relative;
            top: -1187px;
            left: 346px;
        }
        .basicPromp{
            width: 580px;
            opacity: 0.5;
            background: #000000;
            border-radius: 50px;
            font-family: PingFangSC-Medium;
            font-size: 30px;
            height: 80px;
            line-height: 80px;
            text-align: center;
            color: #FFFFFF;
            letter-spacing: 0;
            z-index: 3;
            position: fixed;
            left: 250px;
            bottom: 35px;
            margin: 0 auto;
            display: none;
        }
        .resultclose{
            width: 100px;
            height: 100px;
            background: url("img/resultclose.png") no-repeat 100% 100%;
            position: absolute;
            top: 413px;
            left: 890px;
        }
        .jishi{
            width: 100%;
            height:42px;
            font-size:30px;
            font-weight:600;
            text-align: center;
            color: #10367A;
            line-height:42px;
            letter-spacing:1px;
            position: absolute;
            top: 1728px;
        }
    </style>
</head>
<body>
<div class="commit_head">
    <img src="img/icon.gif" alt="" class="commit_icon"/>
    <span class="commit_build">熊孩子点吧</span>
    <img src="img/close.png" alt="" class="commit_close"/>
</div>
<img class="content" src="./img/result.jpg" alt="">
<img src="img/xingxing.png" class="xingxing"/>
<img src="img/xingxing.png" class="xingxing" id="xing2"/>
<img src="img/xingxing.png" class="xingxing" id="xing3"/>
<div class="pingjia">
</div>
<div class="evaluate">
  <!--  <h1>奇妙园的逻辑思维理念：</h1>-->
    <p></p>
</div>
<div class="phone">
    <img src="img/phone.png"/>
    <input type="text" placeholder="请输入手机号码" id="phone">
</div>
<div class="code">
    <img src="img/code.png"/>
    <input type="text" placeholder="请输入验证码" id="code">
    <button id="send">发送验证码</button>
</div>
<div class="sms">
    请凭短信至线下各门店兑换礼品
</div>
<div class="submit"></div>
<div class="jishi">本页面将在<span></span>秒后自动关闭！</div>
<!--提示弹框-->
<div class="basicPromp"></div>
<div class="resultclose"></div>
<script src="js/jquery-2.2.4.min.js"></script>
<script src="js/getrequest.js"></script>
<script>
    var a=GetRequest();
    var id=a['id'];
    var gameType = 0;
    var ageGroup = 0;
    if(id == "draw3"){
        $(".commit_build").html("画一画");
        gameType = 1;
        ageGroup = 1;
    }else if(id == "draw6"){
        $(".commit_build").html("画一画");
        gameType = 1;
        ageGroup = 2;
    }else if(id == "line3"){
        $(".commit_build").html("连一连");
        gameType = 2;
        ageGroup = 1;
    }else if(id == "line6"){
        $(".commit_build").html("连一连");
        gameType = 2;
        ageGroup = 2;
    }else if(id == "word3"){
        $(".commit_build").html("找一找");
        gameType = 3;
        ageGroup = 1;
    }else if(id == "word6"){
        $(".commit_build").html("找一找");
        gameType = 3;
        ageGroup = 2;
    }
    var mark =a['mark'];
    var xingxing = 0;
    console.log(mark);
    if(id=="draw3"||id=="draw6"){
        $(".evaluate p").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;每个孩子都是天生的艺术家。之于幼儿，艺术不只是画得像不像，而是帮助孩子们培养表达力、发挥想象力的重要途径，奇妙园日托坚持在日常教育中守护孩子的好奇心和想象力；而奇妙园亲子艺术课，则专注于培养孩子感知美好的能力。");
        if(mark>"3"){
            $(".pingjia").html("色彩搭配完美，小小艺术家！");
            xingxing = 3;
        }else if(mark>"0"&&mark<="3"){
            $("#xing3").attr("src","img/xingxing2.png")
            $(".pingjia").html("不错哟，宝贝加油，继续努力！");
            xingxing = 2;
        }else if(mark=="0"){
            $("#xing3,#xing2").attr("src","img/xingxing2.png")
            $(".pingjia").html("加油哦，宝贝的色彩创意还有待提升哦！");
            xingxing = 1;
        }
    }else if(id=="line3"||id=="line6"){
        $(".evaluate p").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0-3岁孩子大脑发育的关键期。奇妙园双语日托以儿童早期脑科学研究成果为指导，提供对孩子身心发展和全脑优化有益的成长环境和日常活动，实现“儿童无意识地玩，教养人有目的地支持与引导”。");
        if(mark=="0"){
            $(".pingjia").html("真棒！宝宝逻辑思维能力超强！");
            xingxing = 3;
        }else if(mark>"0"&&mark<="3"){
            $("#xing3").attr("src","img/xingxing2.png")
            $(".pingjia").html("不错哟，宝贝加油，继续努力！");
            xingxing = 2;
        }else if(mark>"3"){
            $("#xing3,#xing2").attr("src","img/xingxing2.png")
            $(".pingjia").html("加油哦，宝贝的逻辑思维能力还有待提升哦！");
            xingxing = 1;
        }
    }else if(id=="word3"||id=="word6"){
        $(".evaluate p").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0~6岁是儿童语言发展的敏感期。奇妙园双语日托，采用源自美国本土课程，倡导外教每日进班，并参与到日常的生活教育环节，既提高了孩子双语的语感，又让孩子接触到国际多元文化。");
        if(mark=="0"){
            $(".pingjia").html("真棒！专注力超过99%的宝宝!");
            xingxing = 3;
        }else if(mark>"0"&&mark<="3"){
            $("#xing3").attr("src","img/xingxing2.png")
            $(".pingjia").html("不错哟，宝贝加油，继续努力！");
            xingxing = 2;
        }else if(mark>"3"){
            $("#xing3,#xing2").attr("src","img/xingxing2.png")
            $(".pingjia").html("加油哦，宝贝的专注力还有待提升哦！");
            xingxing = 1;
        }
    }
    var count = 60;//60s
    $('.jishi').find("span").html(count);
    /*设置定时器，1s一次*/
    var setone = setInterval(function () {
        count--;
        $('.jishi').find("span").html(count);
        /*判断当count的值小于0的时候隐藏弹出框，并关闭定时器*/
        if (count < 0) {
            show("提交成功，请注意查收短信，谢谢！");
            clearInterval(setone);
            setTimeout(function() {
                window.location.href = "./index.html";
            }, 1500);
        }
    }, 1000);
    var allow = 0;
    $("#phone").on('input propertychange',function(){
        var phone= $('#phone').val();
        var myreg = /^(((13[0-9]{1})|(14[5-9]{1})|(16[6]{1})|(17[0-8]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1})|(19[8-9]{1}))+\d{8})$/;
        if (phone.match(myreg)) {
            allow = 1;
            $("#send").css("background","#5295FF");
            $("#send").css("color","#001A36");
        } else {
            allow = 0;
            $("#send").css("background","#CEDFF4");
            $("#send").css("color","#565656");
        }
    });
    var secondTimer;
    $("#send").click(function () {
        if (allow == 1) {
            count = 60;
            var telValue= $('#phone').val();
            var myreg = /^(((13[0-9]{1})|(14[5-9]{1})|(16[6]{1})|(17[0-8]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1})|(19[8-9]{1}))+\d{8})$/;
            if(telValue.match(myreg)){
                //zhangbin 请求手机验证码
//			 请求验证码成功时，输入框变为不可输入状态，按钮变为不可点击状态，并开始60秒倒计时
                $("#phone").attr('readonly', "true");
                $("#send").addClass('disabled');
                $("#send").attr('disabled', "true");//添加disabled属性
                $("#send").html('已发送(<span class="disabled">59</span>S)');
                var secondObj = $('#send').find('span');
                var secondObjVal = secondObj.html();
                //倒计时
                function secondCounter() {
                    secondTimer = setTimeout(function () {
                        secondObjVal--;
                        secondObj.text(secondObjVal);
                        secondCounter();
                    }, 1000);
                    if (secondObjVal == 0) {
                        clearTimeout(secondTimer);
                        $("#send").removeAttr("disabled");
                        $("#phone").removeAttr("readonly");
                        $("#send").html('重新获取');
                        $("#send").removeClass("disabled");
                    }
                }
                secondCounter();//调用倒计时方法
                getVerificationCode(telValue);
                return true;
            }else{
                show("请输入正确手机号!");
                return false;
            }

        }else{
            show("请输入正确手机号!")
        }
    })
    //点击关闭
    $(".submit").click(function () {
        if(allow == 1){
            submitCode();
        }else{
            show("请输入正确手机号!");
        }
    })

    //请求手机验证码
    function getVerificationCode(phone) {
        $.ajax({
            cache: true,
            type: 'POST',
            url:"http://test.huahaikeji.cn/agent_bizz_platform/index/public/turntableGame/sendMessage",
            data: {"mobile": phone},
            async: true,
            success: function (data) {
                if (data.returnCode == "1000") {
                    return;
                } else {
                    return;
                }
            },
            error: function () {
                return;
            }
        });
    }
    //提交验证码,分数
    function submitCode() {
        var phone= $('#phone').val();
        var agentId = JsBinder.getAgentId();
        var starLevel = xingxing;
        $.ajax({
            cache: true,
            type: 'GET',
            url:"http://192.168.2.92:8080/agent_bizz_platform/index/public/turntableGame/submitChristActivityInfo",
            data: {"gameType": gameType, "ageGroup": ageGroup, "starLevel": starLevel, "phone": phone,"agentId":agentId},
            async: true,
            success: function (data) {
                if (data.returnCode == "1000") {
                    JsBinder.toast("提交成功!");
                    setTimeout(function () {
                        JsBinder.onFinishActivity();
                    },1500)
                } else {
                    $(".codeError").show();
                }
            },
            error: function () {
                return;

            }
        });
    }
    //点击关闭
    $(".commit_close").click(function(){
        //调用安卓方法
        JsBinder.onFinishActivity();
    })
    $(".resultclose").click(function(){
        //返回主页
        window.location.href = "./index.html";
    })
    //提示弹窗方法
    function show(content) {
        $(".basicPromp").html(content);
        $(".basicPromp").show();
        setTimeout(function() {
            $(".basicPromp").hide();
        }, 5000);
    }
    JsBinder.setActivityClose(false); //隐藏浏览器右上角关闭图表
</script>
</body>
</html>